package cn.edu.neusoft.neufooddemo.service;

import java.util.List;

import cn.edu.neusoft.neufooddemo.bean.CollectStatus;
import cn.edu.neusoft.neufooddemo.bean.CommentInfo;
import cn.edu.neusoft.neufooddemo.bean.FoodInfo;
import cn.edu.neusoft.neufooddemo.bean.OrderInfo;
import cn.edu.neusoft.neufooddemo.bean.Result;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by Shinelon on 2017/3/20.
 */

public interface FoodService {

    @GET("getFoodByShop.do")
    Call<List<FoodInfo>> getFoodByShop(
            @Query("shop_id") String shop_id
    );

    @GET("getFoodBySearch.do")
    Call<List<FoodInfo>> getFoodBySearch(
            @Query("search") String search
    );



/*    @GET("getAllOrdersByUser.do")
    Call<List<OrderInfo>> getAllOrdersByUser(
            @Query("user_id") String user_id
    );*/

    @GET("getFoodById.do")
    Call<FoodInfo> getFoodById(
            @Query("food_id") String food_id
    );

    @GET("getAllCommentsByFood.do")
    Call<List<CommentInfo>> getAllCommentsByFood(
            @Query("food_id") String food_id
    );

    @GET("getAllCommentsByUser.do")
    Call<List<CommentInfo>> getAllCommentsByUser(
            @Query("user_id") String user_id
    );

    @GET("getAllOrdersByUser.do")
    Call<List<OrderInfo>> getAllOrdersByUser(
            @Query("user_id") String user_id
    );

    @GET("isCollected.do")
    Call<CollectStatus> isCollected(
            @Query("user_id") String user_id,
            @Query("shop_food_id") String shop_food_id,
            @Query("flag") String flag
    );

    @GET("insertComment.do")
    Call<Result> insertComment(
            @Query("item_id") String item_id,
            @Query("content") String content
    );

    @GET("updateComment.do")
    Call<Result> updateComment(
            @Query("item_id") String item_id,
            @Query("content") String content
    );

    @GET("deleteComment.do")
    Call<Result> deleteComment(
            @Query("item_id") String item_id
    );
    @GET("addCart.do")
    Call<Result> addCart(@Query("user_id") String user_id, @Query("food_id") String food_id, @Query("num") int num);

    @GET("getMyCartByUser.do")
    Call<List<OrderInfo>> getMyCartByUser(@Query("user_id") String user_id);
    @GET("deleteCartItem.do")
    Call<Result> deleteCartItem(@Query("item_id") String item_id);
    @GET("getItemsFromCart.do")
    Call<List<OrderInfo>> getItemsFromCart(@Query("items") String items);
}
